<?php
/**
 * @ClassName: StoreLogic
 * @Description: 门店相关逻辑
 * @author: wyaohu
 * @Date: 2025-07-23 15:56
 * @Version: V1.0.0
 */

namespace app\meituan\logic;

class StoreLogic extends BasicLogic
{
    /**
     * 创建门店
     * @param $params
     * @return bool|string
     */
    public function createStore($params)
    {
        $res = $this->curlRequest('/shop/create', $params);
        return $res;
    }

    /**
     * 修改门店
     * @param $params
     * @return bool|string
     */
    public function updateStore($params)
    {
        $res = $this->curlRequest('/shop/update', $params);
        return $res;
    }

    /**
     * 查询门店信息
     * @param $store_id [发单的门店id]
     * @return bool|string
     */
    public function queryStore($store_id)
    {
        $params = [
            'shop_id' => $store_id,
        ];
        $res = $this->curlRequest('/shop/query', $params);
        return $res;
    }

    /**
     * 查询门店配送范围
     * @param $store_id [取货门店id]
     * @param $delivery_service_code [配送服务代码]
     * @return bool|string
     */
    public function queryStoreArea($store_id, $delivery_service_code)
    {
        $params = [
            'shop_id' => $store_id,
            'delivery_service_code' => $delivery_service_code,
        ];
        $res = $this->curlRequest('/shop/area/query', $params);
        return $res;
    }

    /**
     * 查询门店账户余额
     * @param $store_id [门店ID]
     * @return bool|string
     */
    public function queryStoreBalance($store_id)
    {
        $params = [
            'shop_id' => $store_id
        ];
        $res = $this->curlRequest('/shop/balance/query', $params);
        return $res;
    }

}